/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Service;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Asus
 */
public class Koneksi {
    private static Connection connection;

    public static Connection getConnection() {
        if(connection==null){
            try{
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                String url="jdbc:mysql://localhost:3306/db_ripasien";
                String user="root";
                String pass="";
                connection = DriverManager.getConnection(url,user,pass);
            }catch(Exception e){
                System.out.println("koneksi error");
            }
        }
        return connection;
    }
}
